package com.ciei.dpagm.common.enums;

public enum CircuitGenerationModuleChipColumnEnum {

    /**
     * chipModel 芯片简称
     * "circuitModel", "芯片详细名称"
     */
    CHIP_MODEL(0,"chipModel", "芯片简称"),
    CIRCUIT_MODEL(1,"circuitModel", "芯片详细名称");

    private Integer index;
    private String databaseColumn;
    private String excelColumn;

    CircuitGenerationModuleChipColumnEnum(Integer index,String databaseColumn, String excelColumn) {
        this.index = index;
        this.databaseColumn = databaseColumn;
        this.excelColumn = excelColumn;
    }

    public Integer getIndex() {
        return index;
    }
    public String getDatabaseColumn() {
        return databaseColumn;
    }

    public String getExcelColumn() {
        return excelColumn;
    }

    public CircuitGenerationModuleChipColumnEnum getEnumByDatabaseColumn(String databaseColumn) {
        for (CircuitGenerationModuleChipColumnEnum circuitGenerationModuleChipColumnEnum : CircuitGenerationModuleChipColumnEnum.values()) {
            if (circuitGenerationModuleChipColumnEnum.getDatabaseColumn().equals(databaseColumn)) {
                return circuitGenerationModuleChipColumnEnum;
            }
        }
        return null;
    }

    public CircuitGenerationModuleChipColumnEnum getEnumByExcelColumn(String excelColumn) {
        for (CircuitGenerationModuleChipColumnEnum circuitGenerationModuleChipColumnEnum : CircuitGenerationModuleChipColumnEnum.values()) {
            if (circuitGenerationModuleChipColumnEnum.getExcelColumn().equals(excelColumn)) {
                return circuitGenerationModuleChipColumnEnum;
            }
        }
        return null;
    }

}
